<template>
	<div>
		<WyEditor v-model="content"></WyEditor>
		<div style="margin-top: 20px;">
			<el-button @click="prev" size="small">上一步</el-button>
			<el-button type="primary" size="small" @click="save">保存</el-button>
		</div>
	</div>
</template>

<script>
export default {
  name: 'DetailForm',
  props: {
  	id: {
  		type: Number,
  		default: 0
  	},
	},
  created(){
	  if(this.id){
		  console.log("detail")
		  this.getone()
	  }
  },
  data() {
    return {
		content: '',
    }
  },
  methods: {
		prev() {
			this.$emit('prev')
		},
		save() {
			this.$emit('setForm',{detailHtml: this.content})
			this.$emit('save')
			this.$emit('save:show', false)
		},
		getone(){
			this.get('/pms-product/getone',{id: this.id},response => {
					 this.content=response.detailHtml
					//console.log(this.content)
			})
		}
  }
}
</script>
<style scoped lang="less">
</style>
